package cn.edu.scau.cmi.yanghaorui.client;


//import java.io.IOException;
import java.net.URL;
//import java.util.List;

import cn.edu.scau.cmi.yanghaorui.comprehensiveExperimentFxml.ComprehensiveMyController;

//import javax.print.DocFlavor.URL;

import javafx.application.Application;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
//import javafx.collections.ObservableList;
import javafx.fxml.FXMLLoader;
import javafx.stage.Stage;
//import javafx.scene.Parent;
import javafx.scene.Scene;
//import javafx.scene.control.ComboBox;
//import javafx.scene.control.Label;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
//import javafx.scene.control.ComboBox;
import javafx.scene.layout.AnchorPane;
//import javafx.scene.layout.BorderPane;
//import javafx.scene.control.Label;
//import cn.scau.myfxml.*;


public class ComprehensiveExperimentClient extends Application {
	@Override
	public void start(Stage primaryStage) {
		try {
			
			primaryStage.setTitle("综合性实验");
			FXMLLoader fx=new FXMLLoader();
			URL url=fx.getClassLoader().getResource("cn/edu/scau/cmi/yanghaorui/comprehensiveExperimentFxml/Comprehensive.fxml");
			//System.out.println(fx.getClassLoader().getResource("cn/edu/scau/cmi/yanghaorui/comprehensiveExperimentFxml/Comprehensive.fxml"));
			//fx.setController(this);
			fx.setLocation(url);
			//ComprehensiveMyController mycontroller=new ComprehensiveMyController();
			//fx.setController(mycontroller);
			AnchorPane root1=(AnchorPane)fx.load();
			
			
			//URL url = getClass().getResource("cn.scau.myfxml/Myfxml.fxml");
	        
	      //  AnchorPane root1 = FXMLLoader.load(url);
			
			
			
			ComprehensiveMyController mc=(ComprehensiveMyController)fx.getController();
			//System.out.println(mc.getFxmllabel().getText());
			
			//List<String> value=new ObservableList ();
			//value.add(0,"1");
			
			//mc.getMenu().setValue("11111");设置初始值
			ObservableList <String> value=FXCollections.observableArrayList("one","two");
			//mc.getMenu().setItems(value);
			
			//加载图片
			/*Image image = new Image("11/98348d35c8b09484d9f781bc262d52e.jpg");
			ImageView imageView = new ImageView();
			imageView.setImage(image);*/
			//root1.setLeft(imageView);
		Image image = new Image(getClass().getResourceAsStream("/cn/edu/scau/cmi/yanghaorui/comprehensiveExperimentFxml/201727010222杨浩锐.jpg"),281,405,false,false);
			//Label label3 = new Label("Name", new ImageView(image));
      mc.getPicture().setGraphic(new ImageView(image));

			
			
			
			Scene scene = new Scene(root1);
			
			//scene.getStylesheets().add(getClass().getResource("application.css").toExternalForm());
			
			primaryStage.setScene(scene);
			//primaryStage.setHeight(500);
			//primaryStage.setWidth(500);
			primaryStage.show();
			
			//ComprehensiveMyController mc=(ComprehensiveMyController)fx.getController();
			//System.out.println(mc.getFxmllabel().getText());

			
			/*BorderPane root = new BorderPane();
			Scene scene = new Scene(root,400,400);
			scene.getStylesheets().add(getClass().getResource("application.css").toExternalForm());
			primaryStage.setScene(scene);
			primaryStage.show();*/
		} catch(Exception e) {
			e.printStackTrace();
		}
	}
	
	public static void main(String[] args) {
		launch(args);
	}
}

